
\documentclass{article}

\usepackage{float}

\floatstyle{ruled}
\newfloat{program}{thp}{lop}
\floatname{program}{Program}

\begin{document}

\begin{program}
	\begin{verbatim}

class HelloWorldApp
{
        public static void main(String[] args)
        {
                //Display the string
                System.out.println("Hello World!");
        }
}

	\end{verbatim}
	\caption{The Hello World! program in Java.}
\end{program}


\end{document}

